import request from '@/utils/request'

// 创建设备类别
export function createEqType(data) {
  return request({
    url: '/ems/eq-type/create',
    method: 'post',
    data: data
  })
}

// 更新设备类别
export function updateEqType(data) {
  return request({
    url: '/ems/eq-type/update',
    method: 'put',
    data: data
  })
}

// 删除设备类别
export function deleteEqType(id) {
  return request({
    url: '/ems/eq-type/delete?id=' + id,
    method: 'delete'
  })
}

// 获得设备类别
export function getEqType(id) {
  return request({
    url: '/ems/eq-type/get?id=' + id,
    method: 'get'
  })
}

// 获得设备类别分页
export function getEqTypePage(query) {
  return request({
    url: '/ems/eq-type/page',
    method: 'get',
    params: query
  })
}

// 导出设备类别 Excel
export function exportEqTypeExcel(query) {
  return request({
    url: '/ems/eq-type/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}

export function listEqType(query) {
  return request({
    url: '/ems/eq-type/list',
    method: 'get',
    params: query
  })
}

// 获取精简信息列表
export function listSimpleEqTypes() {
  return request({
    url: 'ems/eq-type/list-all-simple',
    method: 'get'
  })
}
